import { Document } from 'mongoose';

export interface IUserAction extends Document {
  userId: string;
  sessionId?: string;
  action: 'create_session' | 'send_message' | 'upload_file' | 'delete_message' | 'search' | 'export';
  details: {
    target?: string; // 操作目标
    parameters?: Record<string, any>;
    result?: 'success' | 'error' | 'partial';
    errorMessage?: string;
  };
  userAgent?: string;
  ipAddress?: string;
  duration?: number; // 操作耗时（毫秒）
  createdAt: Date;
}
